/*     */ package com.zimbra.cs.client.soap;
/*     */ 
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.soap.DomUtil;
/*     */ import com.zimbra.common.soap.MailConstants;
/*     */ import org.dom4j.DocumentHelper;
/*     */ import org.dom4j.Element;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class LmcFolderActionRequest
/*     */   extends LmcSoapRequest
/*     */ {
/*     */   private String mIDList;
/*     */   private String mOp;
/*     */   private String mTargetFolder;
/*     */   private String mName;
/*     */   private String mPerm;
/*     */   private String mGrantee;
/*     */   private String mD;
/*     */   
/*     */   public void setFolderList(String idList)
/*     */   {
/*  46 */     this.mIDList = idList;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public void setOp(String op)
/*     */   {
/*  54 */     this.mOp = op;
/*     */   }
/*     */   
/*     */   public void setName(String t) {
/*  58 */     this.mName = t;
/*     */   }
/*     */   
/*     */   public void setTargetFolder(String f) {
/*  62 */     this.mTargetFolder = f;
/*     */   }
/*     */   
/*     */   public void setGrant(String perm, String grantee, String d) {
/*  66 */     this.mPerm = perm;
/*  67 */     this.mGrantee = grantee;
/*  68 */     this.mD = d;
/*     */   }
/*     */   
/*     */   public String getFolderList() {
/*  72 */     return this.mIDList;
/*     */   }
/*     */   
/*     */   public String getOp() {
/*  76 */     return this.mOp;
/*     */   }
/*     */   
/*     */   public String getTargetFolder() {
/*  80 */     return this.mTargetFolder;
/*     */   }
/*     */   
/*     */   public String getName() {
/*  84 */     return this.mName;
/*     */   }
/*     */   
/*     */   protected Element getRequestXML() {
/*  88 */     Element request = DocumentHelper.createElement(MailConstants.FOLDER_ACTION_REQUEST);
/*  89 */     Element a = DomUtil.add(request, "action", "");
/*  90 */     if (this.mIDList != null)
/*  91 */       DomUtil.addAttr(a, "id", this.mIDList);
/*  92 */     if (this.mOp != null) {
/*  93 */       DomUtil.addAttr(a, "op", this.mOp);
/*  94 */       if ((this.mOp.equals("grant")) || (this.mOp.equals("!grant")))
/*     */       {
/*  96 */         Element grant = DomUtil.add(a, "grant", "");
/*  97 */         if (this.mPerm != null)
/*  98 */           DomUtil.addAttr(grant, "perm", this.mPerm);
/*  99 */         if (this.mGrantee != null)
/* 100 */           DomUtil.addAttr(grant, "gt", this.mGrantee);
/* 101 */         if (this.mD != null)
/* 102 */           DomUtil.addAttr(grant, "d", this.mD);
/*     */       }
/*     */     }
/* 105 */     if (this.mName != null)
/* 106 */       DomUtil.addAttr(a, "name", this.mName);
/* 107 */     if (this.mTargetFolder != null)
/* 108 */       DomUtil.addAttr(a, "l", this.mTargetFolder);
/* 109 */     return request;
/*     */   }
/*     */   
/*     */   protected LmcSoapResponse parseResponseXML(Element responseXML) throws ServiceException
/*     */   {
/* 114 */     LmcFolderActionResponse response = new LmcFolderActionResponse();
/* 115 */     Element a = DomUtil.get(responseXML, "action");
/* 116 */     response.setFolderList(DomUtil.getAttr(a, "id"));
/* 117 */     response.setOp(DomUtil.getAttr(a, "op"));
/* 118 */     return response;
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/client/soap/LmcFolderActionRequest.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */